﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ScreenMonitor.WcfClientUITest
{
    public partial class Form1 : Form
    {
        MainServiceReference.MainServiceClient TClient = new MainServiceReference.MainServiceClient();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                bool IsSuc = TClient.ServerMain_Init();
                if (IsSuc)
                    MessageBox.Show("初始化成功！");
                else
                    MessageBox.Show("初始化失败！");

            }
            catch (Exception ex)
            {
                MessageBox.Show("初始化失败：" + ex.Message);
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                bool IsSuc = TClient.ServerMain_Start();
                if (IsSuc)
                    MessageBox.Show("启动成功！");
                else
                    MessageBox.Show("启动失败！");
            }
            catch(Exception ex)
            {
                MessageBox.Show("启动失败："+ex.Message);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            TClient.StartWinformServerUI();
        }
    }
}
